﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JMT.Data.Serializer;

namespace JMT.Data
{
    public class JSerializerFactory
    {
        public static JModelSerializer Get(string typeName)
        {
            JModelSerializer serializer = null;
            switch (typeName)
            {
                case JConstString.TGeneralization:
                case JConstString.TAggregation:
                case JConstString.TAssociation:
                case JConstString.TComposition:
                    serializer = new JRelationSerializer();
                    break;
                case JConstString.TElement:
                    serializer = new JElementSerializer();
                    break;
                default:
                    serializer = new JModelSerializer();
                    break;
            }
            return serializer;
        }
    }
}
